var longandlat = [];
var satellites = [];
function fucCheck(INDEX) {
	var i, j, strTemp;
	strTemp = "0123456789";
	for (i = 0; i < INDEX.length; i++) {
		j = strTemp.indexOf(INDEX.charAt(i));
		if (j == -1) {
			//说明有字符不合法     
			return false;
		}
	}
	//说明合法     
	return true;
}
//向前翻页
function pageGoup() {
	//deleteAllImage();//取消所有的image贴图
	var page = document.getElementById("tz").value;
	var allpage = document.getElementById("allpage").value;
	var page = document.getElementById("tz").value;
	if (!fucCheck(page)) {
		alert(validate[3]);
		return false;
	}

	if (page - 1 < 1) {
		jQuery("#tz").val(1);
	} else {
		jQuery("#tz").val(page - 1);
		//alert(page-1);
		var searchname = jQuery("#searchby2d").attr("name");
		if (searchname == 'long') {
			addList(page - 1);
		} else if (searchname == 'national') {
			addListByNational(page - 1);
		}

	}

	return false;
}
//向后翻页
function pageGodown() {
	var page = document.getElementById("tz").value;
	var allpage = document.getElementById("allpage").value;
	if (!fucCheck(page)) {
		alert(validate[4]);
		return false;
	}
	if ((page - 0) + 1 > allpage - 0) {
		jQuery("#tz").val(allpage);
	} else {
		jQuery("#tz").val((page - 0) + 1);
		//alert((page-0)+1);
		var searchname = jQuery("#searchby2d").attr("name");
		if (searchname == 'long') {
			addList((page - 0) + 1);
		} else if (searchname == 'national') {
			addListByNational((page - 0) + 1);
		}

	}

	return false;
}
//直接到首页和末页
function pageGo(str) {
	var allpage = jQuery("#allpages").val();
	var searchname = jQuery("#searchby2d").attr("name");
	if (str == 'all') {
		jQuery("#tz").val(allpage);
		if (searchname == 'long') {
			addList(allpage);
		} else if (searchname == 'national') {
			addListByNational(allpage);
		}
	} else {
		jQuery("#tz").val(1);

		if (searchname == 'long') {
			addList(str);
		} else if (searchname == 'national') {
			addListByNational(str);
		}

	}

	return false;
}
//直接跳转到指定页
function pageGoThis() {
	var page = document.getElementById("tz").value;
	var allpage = document.getElementById("allpage").value;
	if (!fucCheck(page)) {
		alert(validate[5]);
		return false;
	}

	if (page - 0 > allpage - 0) {
		alert(validate[6]);
	} else if (page - 0 < 1) {
		alert(validate[7]);
	} else {
		var searchname = jQuery("#searchby2d").attr("name");
		if (searchname == 'long') {
			addList(page);
		} else if (searchname == 'national') {
			addListByNational(page);
		}

	}

	return false;
}

//调后台数据库取得数据，展示在前台(search 的入口处)--->行政区的查询
function addListByNational(thispage) {
	//alert(dimensional);
	if (!checkQueryAdmin()) {
		return false;
	}//验证

	var tableTrElement = jQuery("#testTable tr");
	var test = jQuery("tr[id*='test']");//选择所有以‘test’模糊查询的tr

	test.remove();//删除前一页的列表
	removeAllFea();//删除原有图层

	//	alert(test);
	//tableTrElement.remove();

	var lTlong = jQuery("#leftTlong").val();
	var lTlat = jQuery("#leftTlat").val();
	var rBlong = jQuery("#rightBlong").val();
	var rBlat = jQuery("#rightBlat").val();
	var proSelect = jQuery("#productlevelSelect").val();

	var imagegsd = jQuery("#imagegsd").val();
	var scenedatestart = jQuery("#scenedatestart").val();
	var scenedateend = jQuery("#scenedateend").val();
	var cloudpercent = jQuery("#cloudpercent").val();
	var overalldataquality = jQuery("#overalldataquality").val();

	var national = jQuery("#national").val();
	var provinceid = jQuery("#province").val();
	var countyid = jQuery("#county").val();

	if (thispage == 'search') {
		longandlat = [];//重新搜索，初始化查询条件
		//卫星传感器
		satellites = [];
		var satelliteCheck = jQuery("input[id*='satellite']");
		satelliteCheck.each(function() {
			var ischeck = jQuery(this).attr('checked');
			if (ischeck == 'checked') {
				satellites.push(jQuery(this).val());
			}
		});
		longandlat.push(lTlong);
		longandlat.push(lTlat);
		longandlat.push(rBlong);
		longandlat.push(rBlat);
		longandlat.push(proSelect);
		longandlat.push(imagegsd);
		longandlat.push(scenedatestart);
		longandlat.push(scenedateend);
		longandlat.push(cloudpercent);
		longandlat.push(overalldataquality);
		//alert(satellites.toString());
		longandlat.push(satellites.toString());

		longandlat.push(national.toString());
		longandlat.push(provinceid.toString());
		longandlat.push(countyid.toString());
		thispage = 1;
		allProduct = [];
		//BuyedProduct = [];
	}
	//alert(leftTlong + leftTlat + rightBlong + rightBlat);

	jQuery
			.post("imagedataquery.html", {
				getpage : thispage,
				leftTlong : longandlat[0],
				leftTlat : longandlat[1],
				rightBlong : longandlat[2],
				rightBlat : longandlat[3],
				prosele : longandlat[4],

				imagegsd : longandlat[5],
				scenedatestart : longandlat[6],
				scenedateend : longandlat[7],
				cloudpercent : longandlat[8],
				overalldataquality : longandlat[9],
				satellites : longandlat[10],
				national : longandlat[11],
				province : longandlat[12],
				county : longandlat[13]
			}, function(data) {
				try {
					
					var jqueryObj = jQuery(data);
					var products = jqueryObj.find("porductid");
					var satellites = jqueryObj.find("satelliteid");
					var sensors = jqueryObj.find("sensorid");

					var scenedates = jqueryObj.find("scenedate");
					var receives = jqueryObj.find("receive");
					var centerlats = jqueryObj.find("centerlat");
					var centerlongs = jqueryObj.find("centerlong");

					//左上角
					var ltlongs = jqueryObj.find("ltlong");
					var ltlats = jqueryObj.find("ltlat");
					//右上角
					var rtlongs = jqueryObj.find("rtlong");
					var rtlats = jqueryObj.find("rtlat");
					//右下角
					var rblongs = jqueryObj.find("rblong");
					var rblats = jqueryObj.find("rblat");
					//左下角
					var lblongs = jqueryObj.find("lblong");
					var lblats = jqueryObj.find("lblat");

					//浏览图
					var browsefile = jqueryObj.find("browsefilelocation");

					//将页数和条数放到页面
					var pageAndData = jqueryObj.find("page").text().split(",");
					jQuery("#alldata").val(pageAndData[0]);
					jQuery("#alldatas").val(pageAndData[0]);
					jQuery("#allpage").val(pageAndData[1]);
					jQuery("#allpages").val(pageAndData[1]);
					jQuery("#tz").val(thispage);

					var productStr = products.text().split(",");
					var satelliteStr = satellites.text().split(",");
					var sensorStr = sensors.text().split(",");

					var scenedateStr = scenedates.text().split(",");
					var receiveStr = receives.text().split(",");
					var centerlatStr = centerlats.text().split(",");
					var centerlongStr = centerlongs.text().split(",");

					var ltlongStr = ltlongs.text().split(",");
					var ltlatStr = ltlats.text().split(",");

					var rtlongStr = rtlongs.text().split(",");
					var rtlatStr = rtlats.text().split(",");

					var rblongStr = rblongs.text().split(",");
					var rblatStr = rblats.text().split(",");

					var lblongStr = lblongs.text().split(",");
					var lblatStr = lblats.text().split(",");

					var browsefileStr = browsefile.text().split(",");

					var size = productStr.length;
					if (productStr[0] != "") {
						for ( var i = 0; i < size; i++) {
							DataToList(rblatStr[i], ltlongStr[i], ltlatStr[i],
									rblongStr[i], satelliteStr[i] + "_"
											+ sensorStr[i] + "_"
											+ productStr[i], rtlongStr[i],
									rtlatStr[i], lblongStr[i], lblatStr[i]);//将数据添加到地图

							var longlathidden = rblatStr[i] + "_"
									+ ltlongStr[i] + "_" + ltlatStr[i] + "_"
									+ rblongStr[i] + "_" + rtlongStr[i] + "_"
									+ rtlatStr[i] + "_" + lblongStr[i] + "_"
									+ lblatStr[i];
							var satelliteandsensor = satelliteStr[i] + "_"
									+ sensorStr[i] + "_" + productStr[i];

							gotoAdd(productStr[i], satelliteStr[i],
									sensorStr[i], receiveStr[i],
									scenedateStr[i], centerlongStr[i],
									centerlatStr[i], longlathidden,
									satelliteandsensor, browsefileStr[i]);//添加一行数据

						}

						addDataToMap();//将框画到地图上
					}

					//翻页勾选以选中的数据
					selectTheProduct();
					//翻页取消勾选
					removeallselect();

					//按用户找出该用户购物车里的产品，并将其回写到页面上
					jQuery
							.post(
									"getProFromShopcar.html",
									{
										str : ""
									},
									function(data) {
										proStr = data.backData.split(",");
										for ( var j = 0; j < proStr.length; j++) {

											jQuery("#" + proStr[j])
													.parent()
													.replaceWith(
															"<td align=\"center\"><input id =\""
																	+ proStr[j]
																	+ "\" type='hidden' /><font color='#E7453D'>"
																	+ validate[0]
																	+ "</font></td>");
											BuyedProduct.push(proStr[j]);
											allProduct = removestr(proStr[j],
													allProduct);//订购成功一条，就要将全局数据中删去此条
										}
									}, 'json');

				} catch (e) {
					alert("Error in XML response:" + e);
				}
			}, 'xml');
}

//调后台数据库取得数据，展示在前台(search 的入口处)--->经纬度的查询
function addList(thispage) {
	//alert(dimensional);
	if (!checkQuery()) {
		return false;
	}//验证

	var tableTrElement = jQuery("#testTable tr");
	var test = jQuery("tr[id*='test']");//选择所有以‘test’模糊查询的tr

	test.remove();//删除前一页的列表
	removeAllFea();//删除原有图层

	//	alert(test);
	//tableTrElement.remove();

	var lTlong = jQuery("#leftTlong").val();//经纬度
	var lTlat = jQuery("#leftTlat").val();
	var rBlong = jQuery("#rightBlong").val();
	var rBlat = jQuery("#rightBlat").val();
	var proSelect = jQuery("#productlevelSelect").val();//数据类型

	var imagegsd = jQuery("#imagegsd").val();//分辨率
	var scenedatestart = jQuery("#scenedatestart").val();//摄影时间
	var scenedateend = jQuery("#scenedateend").val();
	//var cloudpercent = jQuery("#cloudpercent").val();
	var overalldataquality = jQuery("#overalldataquality").val();//比例尺

	if (thispage == 'search') {
		longandlat = [];//重新搜索，初始化查询条件
		//卫星传感器
		satellites = [];
		var satelliteCheck = jQuery("input[id*='satellite']");
		satelliteCheck.each(function() {
			var ischeck = jQuery(this).attr('checked');
			if (ischeck == 'checked') {
				satellites.push(jQuery(this).val());
			}
		});
		longandlat.push(lTlong);
		longandlat.push(lTlat);
		longandlat.push(rBlong);
		longandlat.push(rBlat);
		longandlat.push(proSelect);
		longandlat.push(imagegsd);
		longandlat.push(scenedatestart);
		longandlat.push(scenedateend);
		//longandlat.push(cloudpercent);
		longandlat.push(overalldataquality);
		//alert(satellites.toString());
		//longandlat.push(satellites.toString());
		thispage = 1;
		allProduct = [];
		//BuyedProduct = [];
	}
	//alert(leftTlong + leftTlat + rightBlong + rightBlat);

	jQuery
			.post("imagedataquery.html", {
				getpage : thispage,
				leftTlong : longandlat[0],
				leftTlat : longandlat[1],
				rightBlong : longandlat[2],
				rightBlat : longandlat[3],
				prosele : longandlat[4],

				imagegsd : longandlat[5],
				scenedatestart : longandlat[6],
				scenedateend : longandlat[7],
				//cloudpercent : longandlat[8],
				overalldataquality : longandlat[7],
				//satellites : longandlat[10]
			}, function(data) {
				try {
					var jqueryObj = jQuery(data);
					var products = jqueryObj.find("porductid");
					var satellites = jqueryObj.find("satelliteid");
					var sensors = jqueryObj.find("sensorid");

					var scenedates = jqueryObj.find("scenedate");
					var receives = jqueryObj.find("receive");
					var centerlats = jqueryObj.find("centerlat");
					var centerlongs = jqueryObj.find("centerlong");

					//左上角
					var ltlongs = jqueryObj.find("ltlong");
					var ltlats = jqueryObj.find("ltlat");
					//右上角
					var rtlongs = jqueryObj.find("rtlong");
					var rtlats = jqueryObj.find("rtlat");
					//右下角
					var rblongs = jqueryObj.find("rblong");
					var rblats = jqueryObj.find("rblat");
					//左下角
					var lblongs = jqueryObj.find("lblong");
					var lblats = jqueryObj.find("lblat");
					//浏览图
					var browsefile = jqueryObj.find("browsefilelocation");

					//将页数和条数放到页面
					var pageAndData = jqueryObj.find("page").text().split(",");
					jQuery("#alldata").val(pageAndData[0]);
					jQuery("#alldatas").val(pageAndData[0]);
					jQuery("#allpage").val(pageAndData[1]);
					jQuery("#allpages").val(pageAndData[1]);
					jQuery("#tz").val(thispage);

					var productStr = products.text().split(",");
					var satelliteStr = satellites.text().split(",");
					var sensorStr = sensors.text().split(",");

					var scenedateStr = scenedates.text().split(",");
					var receiveStr = receives.text().split(",");
					var centerlatStr = centerlats.text().split(",");
					var centerlongStr = centerlongs.text().split(",");

					var ltlongStr = ltlongs.text().split(",");
					var ltlatStr = ltlats.text().split(",");

					var rtlongStr = rtlongs.text().split(",");
					var rtlatStr = rtlats.text().split(",");

					var rblongStr = rblongs.text().split(",");
					var rblatStr = rblats.text().split(",");

					var lblongStr = lblongs.text().split(",");
					var lblatStr = lblats.text().split(",");

					var browsefileStr = browsefile.text().split(",");

					var size = productStr.length;
					if (productStr[0] != "") {
						for ( var i = 0; i < size; i++) {
							DataToList(rblatStr[i], ltlongStr[i], ltlatStr[i],
									rblongStr[i], satelliteStr[i] + "_"
											+ sensorStr[i] + "_"
											+ productStr[i], rtlongStr[i],
									rtlatStr[i], lblongStr[i], lblatStr[i]);//将数据添加到地图

							var longlathidden = rblatStr[i] + "_"
									+ ltlongStr[i] + "_" + ltlatStr[i] + "_"
									+ rblongStr[i] + "_" + rtlongStr[i] + "_"
									+ rtlatStr[i] + "_" + lblongStr[i] + "_"
									+ lblatStr[i];
							var satelliteandsensor = satelliteStr[i] + "_"
									+ sensorStr[i] + "_" + productStr[i];

							gotoAdd(productStr[i], satelliteStr[i],
									sensorStr[i], receiveStr[i],
									scenedateStr[i], centerlongStr[i],
									centerlatStr[i], longlathidden,
									satelliteandsensor, browsefileStr[i]);//添加一行数据

						}

						addDataToMap();//将框画到地图上
					}

					//翻页勾选以选中的数据
					selectTheProduct();
					//翻页取消勾选
					removeallselect();

					//按用户找出该用户购物车里的产品，并将其回写到页面上
					jQuery
							.post(
									"getProFromShopcar.html",
									{
										str : ""
									},
									function(data) {
										proStr = data.backData.split(",");
										for ( var j = 0; j < proStr.length; j++) {

											jQuery("#" + proStr[j])
													.parent()
													.replaceWith(
															"<td align=\"center\"><input id =\""
																	+ proStr[j]
																	+ "\" type='hidden' /><font color='#E7453D'>"
																	+ validate[0]
																	+ "</font></td>");
											BuyedProduct.push(proStr[j]);
											allProduct = removestr(proStr[j],
													allProduct);//订购成功一条，就要将全局数据中删去此条
										}
									}, 'json');

				} catch (e) {
					alert("Error in XML response:" + e);
				}
			}, 'xml');
}
//增加一行数据
function gotoAdd(productStr, satelliteStr, sensorStr, receiveStr, scenedateStr,
		centerlongStr, centerlatStr, longlathidden, satelliteandsensor,
		browsefile) {
	var tableTrElement = jQuery("#testTable tr");
	var len = tableTrElement.length;

	var imageData = satelliteStr + "_" + sensorStr + "_" + productStr;
	//alert(imageData);
	//imageData=111;
	var tableElement = jQuery("#testTable");
	tableElement
			.append("<tr onmouseout='heigthLightCrush(\""
					+ imageData
					+ "\")'  onclick='getDataDetails(\""
					+ imageData
					+ "\")' onmouseover = 'heigthLight(\""
					+ imageData
					+ "\")' id=test"
					+ (len + 1)
					+ ">  <input id = \"hidden"
					+ imageData
					+ "\" type=\"hidden\" value = \""
					+ longlathidden
					+ ","
					+ satelliteandsensor
					+ ","
					+ browsefile
					+ "\"/>  <td align=\'center\'><input id = \'"
					+ imageData
					+ "\' name=\'checkbox\' type=\'checkbox\' onclick=\'collectProduct(\""
					+ imageData
					+ "\")\' value=\'"
					+ imageData
					+ "\' /></td> "
//					+ " <td align=\'center\'>  <img onclick = 'atListAddTomap(\""
//					+ imageData
//					+ "\")'  src=\"/APSCO/ext/images/jia.gif\">  </td>   "
					+ "<td align=\'center\'>" + productStr
					+ "</td><td align=\'center\'>" + satelliteStr
					+ "</td><td align=\'center\'>" + sensorStr
					+ "</td><td align=\'center\'>" + receiveStr
					+ "</td><td align=\'center\'>" + scenedateStr
					+ "</td><td align=\'center\'>" + centerlongStr
					+ "</td><td align=\'center\'>" + centerlatStr
					+ "</td></tr>");

	//	jQuery("<tr id=test" + (len + 1) + ">").appendTo(tableElement);
	//	var rtElement = jQuery("#test"+(len + 1));
	//	
	//	jQuery("<td align=\'center\'><input name=\'\' type=\'checkbox\' value=\'\' /></td>").appendTo(rtElement);
	//	jQuery("<td align=\'center\'>"+ productStr + "</td>").appendTo(rtElement);
	//	jQuery("<td align=\'center\'>"+ satelliteStr + "</td>").appendTo(rtElement);
	//	jQuery("<td align=\'center\'>"+ sensorStr + "</td>").appendTo(rtElement);
}
//将所有符合查询条件的数据都贴地图上去
function getAllDataToMap() {

	var searchname = jQuery("#searchby2d").attr("name");
	if (searchname == 'long') {
		if (!checkQuery()) {
			return false;
		}//验证

		var checknull;
		if (longandlat[0] == checknull) {
			alert("没有结果集，不能覆盖全部");
			return false;
		}
		removeAllFea();//删除原有图层

		jQuery.post("allDataSearch.html", {
			leftTlong : longandlat[0],
			leftTlat : longandlat[1],
			rightBlong : longandlat[2],
			rightBlat : longandlat[3],
			prosele : longandlat[4],

			imagegsd : longandlat[5],
			scenedatestart : longandlat[6],
			scenedateend : longandlat[7],
			cloudpercent : longandlat[8],
			overalldataquality : longandlat[9],
			satellites : longandlat[10]
		}, function(data) {
			try {
				var jqueryObj = jQuery(data);
				var products = jqueryObj.find("porductid");
				var satellites = jqueryObj.find("satelliteid");
				var sensors = jqueryObj.find("sensorid");
				var rblats = jqueryObj.find("rblat");
				var ltlongs = jqueryObj.find("ltlong");
				var ltlats = jqueryObj.find("ltlat");
				var rblongs = jqueryObj.find("rblong");
				//右上角
				var rtlongs = jqueryObj.find("rtlong");
				var rtlats = jqueryObj.find("rtlat");

				//左下角
				var lblongs = jqueryObj.find("lblong");
				var lblats = jqueryObj.find("lblat");

				//将页数和条数放到页面
				var productStr = products.text().split(",");
				var satelliteStr = satellites.text().split(",");
				var sensorStr = sensors.text().split(",");
				var rblatStr = rblats.text().split(",");
				var ltlongStr = ltlongs.text().split(",");
				var ltlatStr = ltlats.text().split(",");
				var rblongStr = rblongs.text().split(",");

				var rtlongStr = rtlongs.text().split(",");
				var rtlatStr = rtlats.text().split(",");

				var lblongStr = lblongs.text().split(",");
				var lblatStr = lblats.text().split(",");

				var size = productStr.length;
				if (productStr[0] != "") {
					for ( var i = 0; i < size; i++) {
						DataToList(rblatStr[i], ltlongStr[i], ltlatStr[i],
								rblongStr[i], satelliteStr[i] + "_"
										+ sensorStr[i] + "_" + productStr[i],
								rtlongStr[i], rtlatStr[i], lblongStr[i],
								lblatStr[i]);//将数据添加到地图

					}
					addDataToMap();//将框画到地图上
				}

			} catch (e) {
				alert("Error in XML response:" + e);
			}
		}, 'xml');
	} else if (searchname == 'national') {
		if (!checkQueryAdmin()) {
			return false;
		}//验证

		var checknull;
		if (longandlat[11] == checknull) {
			alert("没有结果集，不能覆盖全部");
			return false;
		}
		removeAllFea();//删除原有图层
		jQuery.post("allDataSearch.html", {
			leftTlong : longandlat[0],
			leftTlat : longandlat[1],
			rightBlong : longandlat[2],
			rightBlat : longandlat[3],
			prosele : longandlat[4],

			imagegsd : longandlat[5],
			scenedatestart : longandlat[6],
			scenedateend : longandlat[7],
			cloudpercent : longandlat[8],
			overalldataquality : longandlat[9],
			satellites : longandlat[10],
			national : longandlat[11],
			province : longandlat[12],
			county : longandlat[13]
		}, function(data) {
			try {
				var jqueryObj = jQuery(data);
				var products = jqueryObj.find("porductid");
				var satellites = jqueryObj.find("satelliteid");
				var sensors = jqueryObj.find("sensorid");
				var rblats = jqueryObj.find("rblat");
				var ltlongs = jqueryObj.find("ltlong");
				var ltlats = jqueryObj.find("ltlat");
				var rblongs = jqueryObj.find("rblong");
				//右上角
				var rtlongs = jqueryObj.find("rtlong");
				var rtlats = jqueryObj.find("rtlat");

				//左下角
				var lblongs = jqueryObj.find("lblong");
				var lblats = jqueryObj.find("lblat");

				//将页数和条数放到页面
				var productStr = products.text().split(",");
				var satelliteStr = satellites.text().split(",");
				var sensorStr = sensors.text().split(",");
				var rblatStr = rblats.text().split(",");
				var ltlongStr = ltlongs.text().split(",");
				var ltlatStr = ltlats.text().split(",");
				var rblongStr = rblongs.text().split(",");

				var rtlongStr = rtlongs.text().split(",");
				var rtlatStr = rtlats.text().split(",");

				var lblongStr = lblongs.text().split(",");
				var lblatStr = lblats.text().split(",");

				var size = productStr.length;
				if (productStr[0] != "") {
					for ( var i = 0; i < size; i++) {
						DataToList(rblatStr[i], ltlongStr[i], ltlatStr[i],
								rblongStr[i], satelliteStr[i] + "_"
										+ sensorStr[i] + "_" + productStr[i],
								rtlongStr[i], rtlatStr[i], lblongStr[i],
								lblatStr[i]);//将数据添加到地图

					}
					addDataToMap();//将框画到地图上
				}

			} catch (e) {
				alert("Error in XML response:" + e);
			}
		}, 'xml');
	}
}

//删除行-->未使用
function gotoDelete(index) {
	var tableTrElement = jQuery("#testTable tr");
	if (index > tableTrElement.length) {
		return;
	} else {
		jQuery("tr[id=\'test" + index + "\']").remove();
		for ( var temp = index + 1; temp <= tableTrElement.length; temp++) {
			jQuery("tr[id=\'test" + temp + "\']")
					.replaceWith(
							"<tr id=test"
									+ (temp - 1)
									+ "><td align=\'center\'>"
									+ (temp - 2)
									+ "</td><td align=\'center\'>"
									+ (temp - 2)
									+ "</td><td align=\'center\'>"
									+ (temp - 2)
									+ "</td><td align=\'center\'><input type=\'button\' value=\'delete\' onclick=\'gotoDelete("
									+ (temp - 1) + ")\'/></td></tr>");
		}
	}
}
